CFLAGS= `pkg-config --cflags dbus-1 scim` -I./dbus-c++.build/include -DHAVE_CONFIG_H
LIBES= `pkg-config --libs dbus-1 scim` 

OBJECTS= main.o scim-dbus-frontend.o tools.o 
libscim-dbus-frontend.so:libdbus-c++-1.a main.o scim-dbus-frontend.o tools.o
	g++  $(LIBES) -shared  main.o scim-dbus-frontend.o tools.o libdbus-c++-1.a -o libscim-dbus-frontend.so
libdbus-c++-1.a:
	./builddbus-c++.sh
main.o:frontend/main.cpp frontend/scim-adaptor.h
	g++ $(CFLAGS) -c frontend/main.cpp -o main.o
scim-dbus-frontend.o:frontend/scim-dbus-frontend.cpp frontend/scim-adaptor.h
	g++ $(CFLAGS) -c frontend/scim-dbus-frontend.cpp -o scim-dbus-frontend.o
tools.o:frontend/tools.cpp frontend/scim-adaptor.h
	g++ $(CFLAGS) -c frontend/tools.cpp -o tools.o

clean:
	rm -rf dbus-c++.build
	rm -rf *.o lib*.so *.a

